<?php
/*
Template Name: City Guide
*/
?>

<style>
    .yarpp-related { display:none; }
</style>

<?php
	global $currentpageid;
	$currentpageid = get_the_ID();
?>

<?php get_header(); ?>
<?php global $woo_options; ?>
       
    <div id="content" class="page col-full">
		<div id="main" class="col-left">
		           
		<?php if ( $woo_options[ 'woo_breadcrumbs_show' ] == 'true' ) { ?>
			<?php woo_breadcrumbs(); ?>  
		<?php } ?>  			

        <?php if (have_posts()) : $count = 0; ?>
        <?php while (have_posts()) : the_post(); $count++; ?>
                                                                    
            <div <?php post_class(); ?>>

			    <h1 class="title"><?php the_title(); ?></h1>
                            <?php include '/home/silicons/public_html/wp-content/themes/woostore/page-include-social-block.php'; ?>

                <div class="entry">
                    
                    <div class="contentinnerleft">
                        <?php the_field('cityguideintro'); ?>
                    </div>
                    <div class="contentinnerright">
                        <?php $fimageurl = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
                        <img src="<?php echo $fimageurl; ?>" alt="<?php the_title(); ?>" />
                    </div>
                    <div style="width:100%;heigh:0px;clear:both"></div>
                    
                    <h2 class="pagesubsectionheader" style="clear:both;margin-top:20px;">Featured <?php the_field('cityname'); ?> Solar Products</h2>
                    <?php the_field('cityguidefeaturedproductstop'); ?>
                    
                    <div class="contentinnerleft">
                        <h2 class="pagesubsectionheader"><?php the_field('cityname'); ?> Solar Initiatives</h2>
                        <?php if(get_field('citysolarinitiaves', $currentpageid)) { ?>
                            <?php while(has_sub_field('citysolarinitiaves', $currentpageid)) : ?>
                                <p style="font-weight:bold;"><?php the_sub_field('cityinitiativename'); ?></p>
                                <p><?php the_sub_field('cityinitiativedescription'); ?></p>
                                <div style="width:100%;height:1px;background:#cccccc;margin-bottom:10px;"></div>
                            <?php endwhile; ?>
                        <?php } ?>
                    </div>
                    <div class="contentinnerright">
                        <h2 class="pagesubsectionheader"><?php the_field('cityname'); ?> Solar Incentives</h2>
                        <?php if(get_field('citysolarincentives', $currentpageid)) { ?>
                            <?php while(has_sub_field('citysolarincentives', $currentpageid)) : ?>
                                <p style="font-weight:bold;"><?php the_sub_field('cityincentivename'); ?></p>
                                <p><?php the_sub_field('cityincentivedescription'); ?></p>
                                <div style="width:100%;height:1px;background:#cccccc;margin-bottom:10px;"></div>
                            <?php endwhile; ?>
                        <?php } ?>
                        
                    </div>
                    <div style="width:100%;heigh:0px;clear:both"></div>
                    
                    <h2 class="pagesubsectionheader" style="clear:both;margin-top:20px;">More Popular <?php the_field('cityname'); ?> Solar Products</h2>
                    <?php the_field('morecityguidesolarproducts'); ?>
                    
                    <h2 class="pagesubsectionheader" style="clear:both;margin-top:20px;">Need Assistance? Ready To Order?</h2>
                    <?php require_once 'page-include-contact-block.php' ; ?>
                    
                	<?php the_content(); ?>
                    
                    
                </div>
            </div>
		<?php endwhile; else: ?>
			<div <?php post_class(); ?>>
            	<p><?php _e( 'Sorry, no posts matched your criteria.', 'woothemes' ) ?></p>
            </div><!-- /.post -->
        <?php endif; ?>  
        
		</div><!-- /#main -->

        <?php get_sidebar(); ?>

    </div><!-- /#content -->
		
<?php get_footer(); ?>